#pragma once
#include<stdio.h>
#include<assert.h>
#include<stdlib.h>
#include"Query.h"
#include<stdbool.h>


typedef char BTDatatype;


typedef struct BinaryTreeNode {
	BTDatatype Data;
	struct BinaryTreeNode* left;
	struct BinaryTreeNode* right;
}BTNode;



BTNode* BuyBTNode(char x);

BTNode* BinaryTreeCreate();

//前序遍历
void preOrder(BTNode* root);


//二叉树节点的个数
//void BinaryTreeSize(BTNode* root,int* size);
int BinaryTreeSize(BTNode* root);


//求二叉树叶子结点的个数
int BinaryTreeLeafSize(BTNode* root);


//二叉树第k层节点的个数
int BinaryTreeKSize(BTNode* root, int k);



//二叉树的深度，高度
int BinaryTreeDepth(BTNode* root);


//二叉树查找节点为x
BTNode* BinaryTreeFind(BTNode* root, BTDatatype x);


//二叉树的销毁
void BinaryTreeDestroy(BTNode** root);




//层序遍历
void levelOrder(BTNode* root);

//判断是否是完全二叉树
bool BinaryTreeComplete(BTNode* root);